/**
 * 
 */
package com.android.demolayoutpages;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.LinearLayout.LayoutParams;

/**
 * @author INVEERA
 * 
 */
public class ExpertsActivity extends BaseActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView();
		setUpView();
	}

	private void setContentView() {

		LinearLayout layoutAppContents = (LinearLayout) findViewById(R.id.layout_app_contents);
		View contentsView = ((LayoutInflater) ExpertsActivity.this
				.getSystemService(ExpertsActivity.this.LAYOUT_INFLATER_SERVICE))
				.inflate(R.layout.layout_app_header, null);
		contentsView.setLayoutParams(new LinearLayout.LayoutParams(
				LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

		layoutAppContents.addView(contentsView);

	}

	private void setUpView() {
		TextView tvselectedTitle = (TextView) findViewById(R.id.txt_selectedTitle);
		tvselectedTitle.setText("select your experts");
		Button btnLeftNevigation = (Button) findViewById(R.id.btn_left_nevigation);
		Button btnRightNevigation = (Button) findViewById(R.id.btn_right_nevigation);
		btnLeftNevigation.setVisibility(View.INVISIBLE);
		btnRightNevigation.setVisibility(View.VISIBLE);
		btnRightNevigation.setText("next");
		btnRightNevigation.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
			 	startActivity(new Intent(ExpertsActivity.this,ChooseGoalBoardActivity.class));
			}
		});

		GridView gvGifts = (GridView) findViewById(R.id.gridView_gifts);

		gvGifts.setAdapter(new ExpertsImageAdapter(ExpertsActivity.this));

		gvGifts.setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				Toast.makeText(view.getContext(), "Position :" + position,
						Toast.LENGTH_SHORT).show();

			}
		});

	}
}
